1. Field of the Invention
The present invention relates to a circuit for processing analog signals, and particularly to an automatic gain control circuit for analog signals.
2. Description of Related Art
The analog-to-digital circuit is usually used in all kinds of equipment such as computers, gauges and industrial controlling apparatus. It can transform analog signals (ex. temperature, pressure etc.) to digital signals that are easily received and further processed by the digital processor.
FIG. 1 (PRIOR ART) is a block diagram of a conventional analog-to-digital circuit with a single multiplication factor. The circuit comprises a signal detector 10, a pre-processing circuit 11, a signal amplifying/attenuating circuit 12, a sample/hold circuit 13, an analog-to-digital converter (ADC) 14 and a microprocessor 15. The signal detector 10 detects an analog input signal Vin. The pre-processing circuit 11 attenuates the analog input signal Vin to an analog signal Vinxe2x80x2 with an amplitude that is acceptable for the system by an attenuation factor 1/a. Then, the signal amplifying/attenuating circuit 12 amplifies or attenuates the analog signal Vinxe2x80x2 to an analog signal Vinxe2x80x3 by an amplification gain b. The sample/hold circuit 13 samples and holds the analog signal Vinxe2x80x3 and the ADC 14 transforms the analog signal to a digital signal. Finally, the digital signal is processed by the microprocessor 15.
The microprocessor 15 regularly triggers the sample/hold circuit 13 to sample the analog signal Vinxe2x80x3 by control lines. Besides, the microprocessor 15 notifies the ADC 14 to transform the sampled signal. After finishing transforming, the ADC 14 notifies the microprocessor 15 to access the digital signal that has been transformed and to perform the numerical operation.
However, the microprocessor 15 should consider the combined multiplication constants b/a that is determined by the attenuation factor 1/a of the pre-processing circuit 11 and the amplification gain b of the signal amplifying/attenuating circuit 12 when the microprocessor 15 performs the numerical operation. The resulted signal amplitude is b/a times of that of the original signal. Therefore, a circuit designer must store a restoring parameter a/b into the calculating program run by the microprocessor 15 to ensure that the numeral result conforms to the input signal Vin.
The above-described circuit architecture and signal-processing scheme are suited for the transforming procedure using one multiplication constant. For a signal-processing scheme requiring a transforming procedure using a plurality of multiplication constants, processing circuits that have switch devices for enabling different multiplication constants are required. As shown in FIG. 2 (Prior Art), the circuit comprises a signal detector 20, a pre-processing circuit using multiple multiplication constants 21, an amplifying/attenuating circuit using multiple multiplication constants 22, a sample/hold circuit 23, an ADC 24 and a microprocessor 25. The pre-processing circuit using multiple multiplication constant 21 employs three attenuation factors, such as 1/a1, 1/a2 and 1/a3, and the amplifying/attenuating circuit using multiple multiplication constants 22 also employs three amplification gains, such as b1, b2 and b3. There are nine combined multiplication constants bn/am, where m=1xcx9c3 and n=1xcx9c3. The circuit designer must store the nine restoring parameters am/bn, where m=1xcx9c3 and n=1xcx9c3, into the calculating program run by the microprocessor 25. In these restoring parameters, the maximum is a3/b3 and the minimum is a1/b1. It can ensure that the numeral result conforms to the original analog input signal Vin. There are two conventional schemes for the microprocessor 25 to select an appropriate restoring parameter. The first scheme is to add a judging program in the calculating program run by the microprocessor 25 and to select the appropriate restoring parameter am/bn in accordance with the result form the deciding program. The second scheme is to select the appropriate restoring parameter manually.
In the first scheme for the selection of the appropriate restoring parameter, as shown in FIG. 2, the restoring parameter is initially set to the maximum a3/b3. Besides, the switch device of the pre-processing circuit 21 is switched to select the attenuation factor 1/a3 and the switch device of the amplifying/attenuating circuit 22 is switched to select the amplification gain b3, respectively. When the calculation/decision result of the microprocessor 25 reveals the overflow status, the microprocessor 25 will calculate and determine the system status by using the next maximal parameter a3/b2. In addition, the microprocessor 25 triggers the switch device of the pre-processing circuit 21 to select the attenuation factor 1/a3 and the switch device of the amplifying/attenuating circuit 22 to select the amplification gain b2, respectively. If the result is still the overflow status, the microprocessor 25 will continue calculating and determining based on the next maximal constant a3/b1. The microprocessor 25 would not stop the calculating and determining procedure until the calculating result conforms to the input signal Vin.
In the second scheme for the selection of the appropriate restoring parameter, a manual switch for changing the multiplication constant 26 is set into the control circuitry, as shown in the FIG. 3 (Prior Art). The structure of the control circuit is similar to that shown in the FIG. 2. The calculating program of the microprocessor 25 also includes a judging program, but does not automatically trigger the switch devices of the pre-processing circuit 21 and the amplifying/attenuating circuit 22, respectively. Depending on whether the calculating result reveals the overflow status or not, the user manually change the manual switch for selecting the multiplication constants 26 to the appropriate location. The manual switch for changing the multiplication constants 26 will not stop changing until the calculating result conforms to the input signal Vin.
The second scheme cannot be widely applied in the industry since it requires manually changing the manual switch for changing the multiplication constants. On the other hand, although the first scheme employs an automatic procedure for adjusting and changing multiplication constants, the microprocessor requires much time in each trial to find out the correct result. Apparently, these two schemes are not suitable for the high-speed system.
Accordingly, the purpose of the present invention is to provide an AGC circuit for analog signals, which produces gain-control signals S1 and S2 for controlling the gain of the signal amplification or attenuation, thereby automatically adjusting the amplification and attenuation of the input signals. In addition, the microprocessor selects one appropriate restoring parameters according to these gain-control signals to ensure that the result can conform to the input signal. When the AGC circuit of the present invention is applied to an analog-to-digital circuit, it can cooperate with the microprocessor to achieve the automatic gain switching function of the input analog signals by the microprocessor. In addition, in the conversion of the input signals, it can provide a quick response for the automatic adjustment of the gain.
For the above purpose, there is a preferred embodiment of an automatic gain control circuit for automatically adjusting an amplitude of an analog input signal, comprising: a buffering circuit for buffering the analog input signal and generating a first signal; an amplifying/attenuating circuit for receiving the first signal form the buffer circuit and attenuating/amplifying an amplitude of the first signal to be an output signal within an operational amplitude range by a gain value of a predetermined gain range; a pre-processing gain-adjusting circuit for receiving the analog input signal, attenuating the amplitude of the analog input signal to a voltage-divided signal within a safe amplitude range, clamping a positive cycle of the voltage-divided signal and outputting the positive cycle of the voltage-divided signal; and an amplification/attenuation gain-adjusting circuit having a comparator, for receiving the positive cycle of the voltage-divided signal from the pre-processing gain-adjusting circuit, generating a DC value by rectifying and filtering the positive cycle of the voltage-divided signal and generating a gain-adjusting signal for selecting the gain value used in the amplifying/attenuation circuit by feeding the DC value to the comparator.
The automatic gain control circuit for automatically adjusting an amplitude of an analog input signal further comprises an analog-to-digital converter having the operational amplitude range for transforming the output signal from the amplifying/attenuating circuit to a digital signal used in a microprocessor. The microprocessor receives the gain-adjusting signal produced by the amplification/attenuation gain-control circuit and selects one of restoring parameters by the gain-adjusting signal.
The buffer circuit is a voltage follower. The input signal is grounded through the high input impedance of the voltage follower. The amplifying/attenuating circuit comprises a first analog multiplexer, a second analog multiplexer, a plurality of precise resistors and a operational amplifier. The pre-processing circuit comprises a voltage-divider, a diode and a buffer amplifier. The amplification/attenuation gain-adjusting circuit includes a rectifying and filtering circuit, a comparator circuit and a diode circuit.
The amplification/attenuation gain-adjusting circuit generates a gain-adjusting signal to control the gain value used in the amplifying/attenuation and automatically adjusts the amplification/attenuation of input signals quickly. The AGC circuit of the present invention is applied to an analog-to-digital circuit, it can cooperate with the microprocessor to achieve the automatic gain switching function of the input analog signals by the microprocessor. In addition, in the conversion of the input signals, it can provide a quick response for the automatic adjustment of the gain.